local gufu = fk.CreateSkill {

  name = "fk__gufu",

  tags = { Skill.Compulsory, },

}

local U = require "packages/utility/utility"


gufu:addEffect("prohibit", {
  name = "fk__gufu",
  frequency = Skill.Compulsory,
  prohibit_use = function(self, player, card)
    if player:hasSkill(gufu.name) and table.find(Fk:currentRoom().alive_players, function(p)
      return p.phase ~= Player.NotActive and p:getMark("fk__kuanyan_target") ~= 0
    end) then
      local subcards = card:isVirtual() and card.subcards or {card.id}
      return #subcards > 0 and table.every(subcards, function(id)
        return table.contains(player:getCardIds(Player.Hand), id)
      end)
    end
  end,
  prohibit_response = function(self, player, card)
    if player:hasSkill(gufu.name) and table.find(Fk:currentRoom().alive_players, function(p)
      return p.phase ~= Player.NotActive and p:getMark("fk__kuanyan_target") ~= 0
    end) then
      local subcards = card:isVirtual() and card.subcards or {card.id}
      return #subcards > 0 and table.every(subcards, function(id)
        return table.contains(player:getCardIds(Player.Hand), id)
      end)
    end
  end,
})

return gufu